package com.jt.util;

import com.jt.pojo.User;
import org.springframework.util.DigestUtils;

/**
 * @author 金帮嘉诚 @date 2021-08-14 星期六 19:06
 */
public class MyUtil {
    private static String myMd5(String password) {
        if (password != null)
            return DigestUtils.md5DigestAsHex(password.getBytes());
        else
            return null;
    }

    public static String mySetM5Password(User user) {
        user.setPassword(myMd5(user.getPassword()));
        return user.getPassword();
    }
}
